<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./css/pintuer.css">
    <link rel="stylesheet" href="./css/admin.css">
    <link rel="stylesheet" href="./element-ui/lib/theme-chalk/index.css">
    <script src="./js/vuejs-2.5.16.js"></script>
    <script src="./element-ui/lib/index.js"></script>
    <script src="./js/axios-0.18.0.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="app" class="container">
        <h1>登录</h1>
        <div class="xs6 xm4 xs3-move xm4-move">
            <div class="panel loginbox">
                <el-form  label-width="80px" >
                    <el-form-item label="用户名" >
                        <el-input v-model="admin.username" placeholder="请输入内容" name="username" ></el-input>
                    </el-form-item>
                    <el-form-item label="密码">
                        <el-input v-model="admin.password" placeholder="请输入密码"  name="password" show-password></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="login()">登录</el-button>
                    </el-form-item>
                </el-form>
                <el-row>
                    <el-button type="success" round @click="weixinLogin()">微信登录</el-button>
                    <el-button type="warning" round @click="faceLogin()">扫脸登录</el-button>
                </el-row>
            </div>
        </div>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                username:"",
                password:"",
                admin:{}
            },
            methods:{
                login(){
                    axios.post("/login", this.admin).then(resp=>{
                        localStorage.setItem("Authorization",resp.data)
                        location.href= "main.html"
                    });
                },
                weixinLogin() {
                    //跳转到微信登录
                    location.href="weixinLogin.html"
                },
                faceLogin() {
                    //跳转到微信登录
                    location.href="facelogin.html"
                }
            },
            created(){

            }
        })
    </script>
</body>
</html>